VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
Begin VB.Form FrmThongKeDiem 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "Thong ke diem"
   ClientHeight    =   8085
   ClientLeft      =   45
   ClientTop       =   375
   ClientWidth     =   12150
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   8085
   ScaleWidth      =   12150
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   Begin VB.Frame Frame 
      Caption         =   "Thong tin chi tiet"
      Height          =   2055
      Left            =   120
      TabIndex        =   0
      Top             =   120
      Width           =   11895
      Begin VB.TextBox txtTenMH 
         Height          =   375
         Left            =   1560
         Locked          =   -1  'True
         TabIndex        =   10
         Top             =   480
         Width           =   4095
      End
      Begin VB.TextBox txtDiemL2 
         Height          =   375
         Left            =   7440
         TabIndex        =   8
         Top             =   960
         Width           =   3975
      End
      Begin VB.TextBox txtDiemL1 
         Height          =   375
         Left            =   1560
         TabIndex        =   6
         Top             =   960
         Width           =   4095
      End
      Begin VB.CommandButton btnChonMH 
         Caption         =   "..."
         Height          =   375
         Left            =   5760
         TabIndex        =   4
         Top             =   480
         Width           =   375
      End
      Begin VB.CommandButton btnThongKe 
         Caption         =   "Thong ke"
         Height          =   375
         Left            =   10200
         TabIndex        =   1
         Top             =   1440
         Width           =   1215
      End
      Begin VB.Label Label3 
         Caption         =   "Diem lan 2"
         Height          =   255
         Left            =   6240
         TabIndex        =   9
         Top             =   1080
         Width           =   975
      End
      Begin VB.Label Label2 
         Caption         =   "Diem lan 1"
         Height          =   255
         Left            =   360
         TabIndex        =   7
         Top             =   1080
         Width           =   975
      End
      Begin VB.Label Label1 
         Caption         =   "Mon hoc"
         Height          =   255
         Left            =   360
         TabIndex        =   5
         Top             =   600
         Width           =   975
      End
   End
   Begin MSComctlLib.ListView lstvData 
      Height          =   5415
      Left            =   120
      TabIndex        =   2
      Top             =   2640
      Width           =   11895
      _ExtentX        =   20981
      _ExtentY        =   9551
      View            =   3
      LabelEdit       =   1
      LabelWrap       =   -1  'True
      HideSelection   =   -1  'True
      FullRowSelect   =   -1  'True
      GridLines       =   -1  'True
      _Version        =   393217
      ForeColor       =   -2147483640
      BackColor       =   -2147483643
      Appearance      =   1
      NumItems        =   0
   End
   Begin VB.Label Label 
      Caption         =   "Danh muc sinh vien tham gia phong trao"
      Height          =   255
      Index           =   0
      Left            =   240
      TabIndex        =   3
      Top             =   2280
      Width           =   4095
   End
End
Attribute VB_Name = "FrmThongKeDiem"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private WithEvents formHSSV As FrmHSSV
Attribute formHSSV.VB_VarHelpID = -1
Private WithEvents formDanhMucMonHoc As FrmDanhMucMonHoc
Attribute formDanhMucMonHoc.VB_VarHelpID = -1
Private m_sMaSV As String
Private m_sMaMH As String
Private m_objDiemTongHop As clsDiemTongHop
Private m_ObjADORst  As ADODB.Recordset

Private Sub btnChonMH_Click()
    Set formDanhMucMonHoc = New FrmDanhMucMonHoc
    formDanhMucMonHoc.EnableBtnChon = True
    formDanhMucMonHoc.Show 1, Me
End Sub

Private Sub btnThongKe_Click()
    Dim i As Integer
    Dim vLstViewItem As ListItem
    
    Set m_objDiemTongHop = New clsDiemTongHop
    Set m_ObjADORst = m_objDiemTongHop.ThongKe(m_sMaMH, txtDiemL1.Text, txtDiemL2.Text)
    lstvData.ListItems.Clear
    i = 1
    
    Do While Not m_ObjADORst.EOF
        Set vLstViewItem = lstvData.ListItems.Add(i)
        vLstViewItem = m_ObjADORst!masv & "#" & m_ObjADORst!mamh
        vLstViewItem.SubItems(1) = m_ObjADORst!HoDem & " " & m_ObjADORst!tensv
        vLstViewItem.SubItems(2) = m_ObjADORst!TenMH
        vLstViewItem.SubItems(3) = m_ObjADORst!dieml1
        vLstViewItem.SubItems(4) = m_ObjADORst!dieml2
        vLstViewItem.SubItems(5) = m_ObjADORst!hocky
        m_ObjADORst.MoveNext
        i = i + 1
    Loop

End Sub

Private Sub Form_Load()
    Init
End Sub

Public Sub Init()
    lstvData.ColumnHeaders.Clear
    lstvData.ColumnHeaders.Add , , "MaSV#MaMH", lstvData.Width / 6
    lstvData.ColumnHeaders.Add , , "Sinh vien", lstvData.Width / 6
    lstvData.ColumnHeaders.Add , , "Mon hoc", lstvData.Width / 6
    lstvData.ColumnHeaders.Add , , "DiemL1", lstvData.Width / 6
    lstvData.ColumnHeaders.Add , , "DiemL2", lstvData.Width / 6
    lstvData.ColumnHeaders.Add , , "Hoc ky", lstvData.Width / 6
End Sub

Private Sub formDanhMucMonHoc_EVENTChooseItem(ByVal madd As String, ByVal tendd As String)
    m_sMaMH = madd
    txtTenMH.Text = tendd
End Sub
